// 求子集2 90
// [1,2,2] 返回的子集去除重复
function findChild2(nums) {
    let n = nums.length;
    nums = nums.sort((a, b) => a - b);
    let tmpPath = [];
    let res = [];
    let backTrace = (tmpPath, start) => {
        res.push(tmpPath);
        for (let i = start; i < n; i++) {
            // i > start 代表的是同层重复, 同层重复跳过
            if (i > start && nums[i] === nums[i - 1]) continue
            tmpPath.push(nums[i]);
            backTrace(tmpPath.slice(), i + 1);
            tmpPath.pop();
        }
    }
    backTrace(tmpPath, 0);
    return res;
}